package com.example.demo.vo;

import lombok.Data;

@Data
public class DataView {
    private Object data;
    private Integer code;
    private String msg;

    public static DataView success(Object data)
    {
        DataView dataView = new DataView();
        dataView.setData(data);
        dataView.setCode(200);
        dataView.setMsg("成功");
        return dataView;
    }

    public static DataView fail(Integer code,String msg)
    {
        DataView dataView = new DataView();
        dataView.setCode(code);
        dataView.setMsg(msg);
        return dataView;
    }
}
